package com.xxx.yuedong.community.loadcache;

import com.xxx.yuedong.community.service.DynamicLikeService;
import com.xxx.yuedong.community.service.FollowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 缓存预加载器
 *
 * @Author YinXi
 * @Versin 1.0.0
 * @Date 2023/8/25
 */
@Slf4j
@Component
public class LoadCacheRunner implements ApplicationRunner {
    @Autowired
    private DynamicLikeService dynamicLikeService;
    @Autowired
    private FollowService followService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        dynamicLikeService.rebulidDynamicLikeCache();
        followService.rebulidFollowList();
    }
}
